<template>
  <formText v-if="item.TYP ==='txt'" :source="item"></formText>
  <formNumber v-else-if="item.TYP ==='number'" :source="item"></formNumber>
  <formTextarea v-else-if="item.TYP === 'txtarea'" :source="item"></formTextarea>
  <formRadio v-else-if="item.TYP === 'radio'" :source="item"></formRadio>
  <formCheckbox v-else-if="item.TYP === 'checkbox'" :source="item"></formCheckbox>
  <formSelect v-else-if="item.TYP === 'select'" :source="item"></formSelect>
  <formDate v-else-if="item.TYP === 'date'" :source="item"></formDate>
  <formTime v-else-if="item.TYP === 'time'" :source="item"></formTime>
  <formFile v-else-if="item.TYP === 'file'" :source="item"></formFile>
</template>
<script>
import formText from "@/components/form/text.vue";
import formNumber from "@/components/form/number.vue";
import formTextarea from "@/components/form/textarea.vue";
import formRadio from "@/components/form/radio.vue";
import formCheckbox from "@/components/form/checkbox.vue";
import formSelect from "@/components/form/select.vue";
import formDate from "@/components/form/date.vue";
import formTime from "@/components/form/time.vue";
import formFile from "@/components/form/file.vue";
export default {
  name: "formItem",
  props: {
    item: {
      type: Object,
      default() {
        return {};
      }
    }
  },
  components: {
    formText,
    formTextarea,
    formNumber,
    formRadio,
    formCheckbox,
    formSelect,
    formDate,
    formTime,
    formFile
  }
};
</script>
<style lang="scss" scoped>
</style>